package com.cars.dao.util;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * @author Dhruva
 * 
 */
public class ConectionManager {

	private static ConectionManager instance = null;
	private static Connection connection =null;

	private ConectionManager() {

	}

	public static ConectionManager getInstance() {

		if (null == instance) {
			instance = new ConectionManager();
		}

		return instance;
	}
	
	
	 
	public Connection getConnection() {
		try {
			
			if(connection == null)
			{ 
			Class.forName("com.mysql.jdbc.Driver");

			connection = DriverManager.getConnection(
					"jdbc:mysql://localhost:3306/classicmodels", "root",
					"root");
			}
		} catch (Exception exception) {

		}
		return connection;

	}

}
